//
// Created by Administrator on 2021/12/2.
//
#include "iostream"
#include "DonorList.h"

using namespace std;

int main()
{
//    DonorList listThis;
//    listThis.createList();
//    listThis.printAllDonors();
//    cout << endl;
//
//    DonorList another(listThis);
//    cout << "this list is:" << endl;
//    listThis.printAllDonors();
//    cout << "another list is:" << endl;
//    another.printAllDonors();
//    cout << endl;

    DonorList list1;
    DonorList list2;
    for (int i = 0; i < 4; ++i) {
        list2.addDonor("first" + to_string(i), "last" + to_string(i), i, i);
    }
    cout << "list1 is:" << endl;
    list1.printAllDonors();
    cout << "list2 is:" << endl;
    list2.printAllDonors();
    list1 = list2;
    cout << "list1 is:" << endl;
    list1.printAllDonors();
    cout << "list2 is:" << endl;
    list2.printAllDonors();
    list2.clearList();
    cout << "list1 is:" << endl;
    list1.printAllDonors();
    cout << "list2 is:" << endl;
    list2.printAllDonors();
    cout << endl;

    list1.clearList();
    list2.clearList();
    for (int i = 0; i < 4; ++i) {
        list1.addDonor("1first" + to_string(i), "1last" + to_string(i), i, i);
        list2.addDonor("2first" + to_string(i), "2last" + to_string(i), i, i);
    }
    cout << "list1 is:" << endl;
    list1.printAllDonors();
    cout << "list2 is:" << endl;
    list2.printAllDonors();
    list1 = list2;
    cout << "list1 is:" << endl;
    list1.printAllDonors();
    cout << "list2 is:" << endl;
    list2.printAllDonors();
    list2.clearList();
    cout << "list1 is:" << endl;
    list1.printAllDonors();
    cout << "list2 is:" << endl;
    list2.printAllDonors();
    cout << endl;

    list1.clearList();
    list2.clearList();
    for (int i = 0; i < 4; ++i) {
        list1.addDonor("1first" + to_string(i), "1last" + to_string(i), i, i);
        if (i < 2) {
            list2.addDonor("2first" + to_string(i), "2last" + to_string(i), i, i);
        }
    }
    cout << "list1 is:" << endl;
    list1.printAllDonors();
    cout << "list2 is:" << endl;
    list2.printAllDonors();
    list1 = list2;
    cout << "list1 is:" << endl;
    list1.printAllDonors();
    cout << "list2 is:" << endl;
    list2.printAllDonors();
    list2.clearList();
    cout << "list1 is:" << endl;
    list1.printAllDonors();
    cout << "list2 is:" << endl;
    list2.printAllDonors();
    cout << endl;

    list1.clearList();
    list2.clearList();
    for (int i = 0; i < 4; ++i) {
        list2.addDonor("2first" + to_string(i), "2last" + to_string(i), i, i);
        if (i < 2) {
            list1.addDonor("1first" + to_string(i), "1last" + to_string(i), i, i);
        }
    }
    cout << "list1 is:" << endl;
    list1.printAllDonors();
    cout << "list2 is:" << endl;
    list2.printAllDonors();
    list1 = list2;
    cout << "list1 is:" << endl;
    list1.printAllDonors();
    cout << "list2 is:" << endl;
    list2.printAllDonors();
    list2.clearList();
    cout << "list1 is:" << endl;
    list1.printAllDonors();
    cout << "list2 is:" << endl;
    list2.printAllDonors();
    cout << endl;

    list1.clearList();
    for (int i = 0; i < 2; ++i) {
        list1.addDonor("1first" + to_string(i), "1last" + to_string(i), i, i);
    }
    list1 = list1;
    return 0;
}

